@import "~./_vars";
@import "~./_mixins";

* { padding: 0px; margin: 0px; border: 0px; box-sizing: border-box; }
html, body { height: 100%; }

body {
	font-family: 'Inter'; @include text-common; color: var(--color-text-primary); overflow: hidden; background: var(--color-bg-primary);
	-webkit-font-smoothing: antialiased; backface-visibility: hidden; transform-style: flat; overscroll-behavior: none; scrollbar-gutter: stable;
}
body.colResize { cursor: col-resize !important; }
body.colResize * { cursor: col-resize !important; user-select: none !important; }
body.rowResize { cursor: row-resize !important; }
body.rowResize * { cursor: row-resize !important; user-select: none !important; }
body.wResize { cursor: w-resize !important; }
body.eResize { cursor: e-resize !important; }

body.grab, body.isDragging { cursor: grab !important; }
body.isFullScreen {
	#menuBar { display: none; }
}

:focus { outline: 0px; }
::selection { background-color: var(--color-system-selection); }

@keyframes rotate {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus
input:-webkit-autofill, 
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus { transition: background-color 5000s ease-in-out 0s; }
input, textarea, select { font-family: 'Inter'; }

#root { height: 100%; }
#appContainer { display: flex; flex-direction: column; height: 100%; }
#selection { flex-grow: 1; overflow: hidden; }

#menuBar { -webkit-app-region: drag; position: fixed; top: 0px; left: 0px; width: 100%; height: 52px; z-index: -1; user-select: none; pointer-events: all; }

#root-loader { position: fixed; width: 100%; height: 100%; left: 0px; top: 0px; background: #060606; z-index: 1000; transition: opacity 0.3s ease-in-out; }
#root-loader {
	.inner { 
		width: 120px; text-align: center; position: absolute; transform: translate3d(-50%,-50%,0px); display: flex; flex-direction: column; gap: 6px 0px;
		left: 50%; top: 50%;
	}
	.anim { opacity: 1; transform: scale3d(1,1,1); transition-duration: 0.3s; transition-property: opacity, transform; transition-timing-function: ease-in-out; }
	.anim.from { opacity: 0; transform: scale3d(0.8,0.8,1); }
	.anim.to { opacity: 0; transform: translate3d(0px,-20px,0px); }

	.logo { width: 120px; height: 24px; background: url('~img/logo/color.svg') no-repeat; background-size: 100%; }
	.version { @include text-small; color: var(--color-text-inversion); transition-delay: 0.15s; }
}

#globalFade { 
	position: fixed; z-index: 23; background: var(--color-bg-primary); right: 0px; top: 0px; width: 100%; height: 100%; display: none; opacity: 0; 
	transition: opacity 0.3s ease-in-out;
}
#globalFade {
	#loader { position: absolute; right: 0px; top: 0px; width: 100%; height: 100%; width: calc(100% - $vaultWidthCollapsed); }
}
#globalFade.show { opacity: 1; }
#graphPreview { position: fixed; z-index: 1000; }

#mainAnimation { display: none; }

.onboardingDimmer { content: ''; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; background: rgba(0,0,0,0.4); -webkit-app-region: no-drag; z-index: 999; pointer-events: none; }

.ReactVirtualized__List { overscroll-behavior: none; }

html.platformWindows {
	body { overflow-y: overlay; }
}

html.platformLinux {
	body { overflow-y: auto; }
}

.customScrollbar {
	::-webkit-scrollbar, &::-webkit-scrollbar { width: 6px; height: 6px; }
	::-webkit-scrollbar-thumb, &::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
	::-webkit-scrollbar-corner, &::-webkit-scrollbar-corner { background-color: transparent; }
	::-webkit-scrollbar-button, &::-webkit-scrollbar-button { display: none; }
}
.customScrollbar:hover {
	::-webkit-scrollbar-thumb, &::-webkit-scrollbar-thumb { background: var(--color-control-active); }
}

html.platformWindows, html.platformLinux {
	::-webkit-scrollbar { width: 6px; height: 6px; }
	::-webkit-scrollbar-thumb { background: var(--color-control-active); border-radius: 6px; }
	::-webkit-scrollbar-corner { background-color: transparent; }
	::-webkit-scrollbar-button { display: none; }
}

.dn { display: none !important; }
.txt { vertical-align: middle; display: inline-block; line-height: 1; }
.flex { display: flex; }
.nw { white-space: nowrap; }
.passThrough { pointer-events: none; }
.rel { position: relative; }
.disabled { opacity: 0.5; cursor: default !important; }
.dis { cursor: default !important; }
.isReadonly { -webkit-user-modify: unset !important; cursor: default !important; }
.no-br { border-radius: unset !important; }
.noAnimation { transition: none !important; }
.over, .overPopup { overflow: hidden !important; }
.empty, .emptyText { color: var(--color-text-tertiary); }
.isDone { color: var(--color-text-secondary); }
.placeholder { 
	pointer-events: none; color: var(--color-text-tertiary); position: absolute; left: 0px; top: 0px; z-index: 0; width: 100%; height: 100%; cursor: text; 
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
::-webkit-input-placeholder { color: var(--color-text-tertiary) !important; }
.isBlurred { filter: blur(7px); }
.animationWord { display: inline-block; }
.isRtl { direction: rtl; }
.isOnboardingHidden { visibility: hidden; }

.fileWrap { position: relative; overflow: hidden; }
.fileWrap { 
	.input-file { position: absolute; left: 0px; top: 0px; opacity: 0; width: 100%; height: 100%; z-index: 100; padding: 0px; } 
}

.editableWrap { position: relative; }

a { color: var(--color-text-primary); }

.dropTarget.isOver.middle { background: var(--color-system-drop-zone) !important; }
.dropTarget.isOver.top { box-shadow: 0px -2px 0px var(--color-control-accent); }
.dropTarget.isOver.bottom { box-shadow: 0px 2px 0px var(--color-control-accent); }
.dropTarget.isOver.left { box-shadow: -2px 0px 0px var(--color-control-accent); }
.dropTarget.isOver.right { box-shadow: 2px 0px 0px var(--color-control-accent); }

/* DropTarget for Layout.Row */
.dropTarget.targetTop.isOver.top { box-shadow: 0px -2px 0px var(--color-control-accent) inset; }
.dropTarget.targetBot.isOver.bottom { box-shadow: 0px 2px 0px var(--color-control-accent) inset; }

/* Diff elements for history */
.diffAdd, .diffChange, .diffRemove { position: relative; }
.diffAdd::after, .diffChange::after, .diffRemove::after { content: ""; border-radius: inherit; opacity: 0.5; pointer-events: none; }
.diffAdd::after, .diffChange::after	{ position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 10; }
.diffRemove::after { position: relative; height: 30px; display: block; width: 100%; }
.diffAdd::after { background-color: var(--color-shape-highlight-add); }
.diffChange::after { background-color: var(--color-shape-highlight-change); }
.diffRemove::after { background-color: var(--color-shape-highlight-remove); }

.isSelectionSelected { position: relative; }

.selectionTarget.isSelectionSelected::after, 
.block.isSelectionSelected > .wrapContent > .selectionTarget::after 
{ 
	display: block; position: absolute; left: -2px; top: 0px; width: calc(100% + 4px); height: 100%; background-color: var(--color-system-selection);
	pointer-events: none; z-index: 10; content: ""; border-radius: 2px;
}

.textColor-default { color: var(--color-text-primary) !important; }
.textColor-black { color: var(--color-text-primary) !important; }
.textColor-grey { color: var(--color-control-active) !important; }
.textColor-yellow { color: var(--color-yellow) !important; }
.textColor-orange { color: var(--color-orange) !important; }
.textColor-red { color: var(--color-red) !important; }
.textColor-pink { color: var(--color-pink) !important; }
.textColor-purple { color: var(--color-purple) !important; }
.textColor-blue { color: var(--color-blue) !important; }
.textColor-ice { color: var(--color-ice) !important; }
.textColor-teal { color: var(--color-teal) !important; }
.textColor-lime { color: var(--color-lime) !important; }

.bgColor-grey { background: var(--color-shape-tertiary) !important; }
.bgColor-yellow { background: var(--color-bg-yellow) !important; }
.bgColor-orange { background: var(--color-bg-orange) !important; }
.bgColor-red { background: var(--color-bg-red) !important; }
.bgColor-pink { background: var(--color-bg-pink) !important; }
.bgColor-purple { background: var(--color-bg-purple) !important; }
.bgColor-blue { background: var(--color-bg-blue) !important; }
.bgColor-ice { background: var(--color-bg-ice) !important; }
.bgColor-teal { background: var(--color-bg-teal) !important; }
.bgColor-lime { background: var(--color-bg-lime) !important; }

.isMultiSelect.archive { color: var(--color-text-secondary); background: var(--color-shape-tertiary); }
.isMultiSelect.tagColor-default { color: var(--color-text-primary) !important; background: var(--color-bg-primary) !important; box-shadow: 0px 0px 0px 1px var(--color-shape-secondary) inset; }
.isMultiSelect.tagColor-grey { color: var(--color-tag-grey) !important; background: var(--color-bg-tag-grey) !important; }
.isMultiSelect.tagColor-yellow { color: var(--color-tag-yellow) !important; background: var(--color-bg-tag-yellow) !important; }
.isMultiSelect.tagColor-orange { color: var(--color-tag-orange) !important; background: var(--color-bg-tag-orange) !important; }
.isMultiSelect.tagColor-red { color: var(--color-tag-red) !important; background: var(--color-bg-tag-red) !important; }
.isMultiSelect.tagColor-pink { color: var(--color-tag-pink) !important; background: var(--color-bg-tag-pink) !important; }
.isMultiSelect.tagColor-purple { color: var(--color-tag-purple) !important; background: var(--color-bg-tag-purple) !important; }
.isMultiSelect.tagColor-blue { color: var(--color-tag-blue) !important; background: var(--color-bg-tag-blue) !important; }
.isMultiSelect.tagColor-ice { color: var(--color-tag-ice) !important; background: var(--color-bg-tag-ice) !important; }
.isMultiSelect.tagColor-teal { color: var(--color-tag-teal) !important; background: var(--color-bg-tag-teal) !important; }
.isMultiSelect.tagColor-lime { color: var(--color-tag-lime) !important; background: var(--color-bg-tag-lime) !important; }

.isSelect.tagColor-default { color: var(--color-text-primary) !important; }
.isSelect.tagColor-black { color: var(--color-text-primary) !important; }
.isSelect.tagColor-grey { color: var(--color-control-active) !important; }
.isSelect.tagColor-yellow { color: var(--color-yellow) !important; }
.isSelect.tagColor-orange { color: var(--color-orange) !important; }
.isSelect.tagColor-red { color: var(--color-red) !important; }
.isSelect.tagColor-pink { color: var(--color-pink) !important; }
.isSelect.tagColor-purple { color: var(--color-purple) !important; }
.isSelect.tagColor-blue { color: var(--color-blue) !important; }
.isSelect.tagColor-ice { color: var(--color-ice) !important; }
.isSelect.tagColor-teal { color: var(--color-teal) !important; }
.isSelect.tagColor-lime { color: var(--color-lime) !important; }

.brokenMedia { 
	@include text-common; position: relative; width: 100%; line-height: 20px; padding: 11px 13px; border-radius: 6px; border: solid 1px var(--color-shape-secondary); 
	color: var(--color-control-active); height: 44px;
}
.brokenMedia {
	img:before { 
		content: " "; display: block; position: absolute; left: 0px; top: 0px; height: 100%; width: 100%;
		background: var(--color-bg-primary); border-radius: inherit;
	}

	img:after { 
		content: "🔗" " Image is broken"; display: block; text-align: center; position: absolute; left: 0px; top: 0px; 
		@include text-overflow-nw; padding: 11px 13px; width: calc(100% - 26px); height: calc(100% - 22px);
		display: flex; align-items: center; justify-content: center;
	}
	
	.icon.resize { display: none; }
	.icon.download { display: none; }
}

@import "./debug";
@import "./font";
@import "./component/common.scss";
@import "./page/common.scss";
@import "./block/common.scss";
@import "./form/common.scss";
@import "./list/common.scss";
@import "./widget/common.scss";
@import "./popup/common.scss";
@import "./menu/common.scss";
@import "./notification/common.scss";

@import "./media/print.scss";
@import "./theme/dark/common.scss";

html.platformWindows:not(.noMenuBar) {
	#menuBar { 
		height: 28px; background: var(--color-shape-primary); position: relative; flex-shrink: 0; z-index: 100000; display: flex; align-items: center; 
		flex-direction: row;
	}
	#menuBar {
		.side { width: 50%; height: 100%; display: flex; align-items: center; padding: 0px 12px; @include text-small; font-weight: 500; }
		.side.left { justify-content: flex-start; gap: 0px 2px; }
		.side.right { justify-content: flex-end; }

		.icon { width: 28px !important; height: 100% !important; border-radius: 0px !important; background-size: 12px !important; -webkit-app-region: no-drag; }
		.icon.window-menu { background-image: url('~img/icon/window/menu.svg'); }
		.icon.window-min { background-image: url('~img/icon/window/min.svg'); }
		.icon.window-max { background-image: url('~img/icon/window/max.svg'); }
		.icon.window-close { background-image: url('~img/icon/window/close.svg'); }
	}

	.sidebar { margin-top: 28px; height: calc(100% - 28px); }
	.sidebarHeadIcon { top: 48px; }

	.popups {
		.popup.popupShortcut {
			.innerWrap { top: 28px; height: calc(100% - 28px); }
		}
	}
}